package org.shj.algorithm;

import java.time.YearMonth;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

public class Test {

	public static void main(String[] args){

		System.out.println(".*234.*sf.*".replaceAll("\\.\\*", "\\*"));

		String str = "本报/r	北京/ns	从/p	[广播/vn	电影/n	电视/n	部/n]/nt	获悉/v	：/w	 [自/p	１９９８年/t	１月/t	１日/t	起/f]/n	，/w	我国/n	";
		String[] arr = str.split("\\s+");
		List<String[]> words = new ArrayList<>();
		StringBuilder another = new StringBuilder();
		boolean start = false;
		for(String s : arr){
			String[] word = s.split("/");
			if(s.startsWith("[")){
				start = true;
				word[0] = word[0].substring(1);
			}
			if(start){
				another.append(word[0]);
			}

			if(!start){
				System.out.println(word[0] + "/" + word[1]);
			}
			if(word.length > 2){
				start = false;
				word[1] = word[1].substring(0, word[1].length() - 1);
				//System.out.println(word[0] + "/" + word[1]);
				System.out.println(another + "/" + word[2]);
				another.delete(0, another.length());
			}
		}

		str = "HGNU-Student-Auto,����-Student-A";
		System.out.println(str.length());


		YearMonth yearMonth = YearMonth.parse("2020-01");
		System.out.println(yearMonth.minusMonths(1).toString());

		Integer a = 10;
		Integer b = 20;
		a = a^b;
		System.out.println(a);
		System.out.println(b);
		b = b^a;
		System.out.println(a);
		System.out.println(b);
		a = a^b;
		System.out.println(a);
		System.out.println(b);
		
		System.out.println(b >> 1);

		Calendar calendar = Calendar.getInstance();
		System.out.println(calendar.getTimeInMillis());

		String zero = "0.123";
		System.out.println(zero.indexOf("."));
		System.out.println(zero.substring(zero.length() - 1));


	}
}
